package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.user.service.ApUserRealnameService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author tmh
 * @date 2023/8/28 9:45
 * @description
 */
@Slf4j
@RestController
@RequestMapping("/api/v1/auth")
public class ApUserAuthController {

    @Autowired
    private ApUserRealnameService apUserRealnameService;

    /**
     * 用户审核查询列表
     * @param authDto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult userAuthList(@RequestBody AuthDto authDto){
        return apUserRealnameService.userAuthList(authDto);
    }

    /**
     * 审核失败
     * @param authDto
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult userAuthFail(@RequestBody AuthDto authDto){
        return apUserRealnameService.authFail(authDto);
    }

    /**
     * 用户审核成功
     * @param authDto
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult userAuthPass(@RequestBody AuthDto authDto){
        return apUserRealnameService.authPass(authDto);
    }
}
